home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DIRS.SWG / 0013_MAKEDIR2.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  741b  |  23 lines

  1. {
  2.     Hi Mark, there is a Procedure in Turbo Pascal called MkDir that allows
  3. you to create a subdirectory. However if you want source code For a similar
  4. routine try the following. I just whipped it up so it doesn't contain any
  5. error checking, but you could add a simple if else after the Dos call to
  6. check the register flags. Anyhow, I hope that this helps ya out.
  7. }
  8. Procedure Make_Directory (Directory: String);
  9. { parameters:  Directory - name of the new directory
  10.   sample-call: Make_Directory('\tools') }
  11. Var
  12.     Regs: Registers;
  13. begin
  14.   With Regs do
  15.   begin
  16.     Directory := Directory + chr(0);
  17.     AX := $3900;
  18.     DS := Seg(Directory[1]);
  19.     DX := ofs(Directory[1]);
  20.     MSDos(Dos.Registers(Regs));
  21.   end;
  22. end;
  23.